package com.say.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;

import com.say.bean.domain.Message;
import com.say.dao.BaseQueryDao;
import com.say.dao.MessageDao;
import com.say.framework.core.common.service.BaseServiceImpl;
import com.say.service.MessageService;


/**
 * 
 * 类名称：ConfigServiceImpl<br>
 * 类描述：系统参数服务接口实现<br>
 * @version v1.0
 *
 */
@Service("messageService")
public class MessageServiceImpl extends BaseServiceImpl<Message, String> implements MessageService {

    @Autowired
    public MessageDao messageDao;
    
    @Autowired
    public BaseQueryDao baseQueryDao;

    @Override
    public PagingAndSortingRepository<Message, String> getDao() {
        return messageDao;
    }

	@Override
	public Page<Map<String, Object>> findMessageByPage(Map<String, Object> params, Pageable initPage) {
		return baseQueryDao.findMessageByPage(params, initPage);
	}

	@Override
	public Message getMessageByUserIdAndToUserId(String userId, String toUserId) {
		return messageDao.getMessageByUserIdAndToUserId(userId, toUserId);
	}

	@Override
	public void saveUnReadMessageById(String id, Integer unRead, String text) {
		messageDao.saveUnReadMessageById(id, unRead, text);
	}

	@Override
	public void clearUnReadMessageByUser(String userId, String toUserId) {
		messageDao.clearUnReadMessageByUser(userId, toUserId);
	}



   

	
}
